<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <meta name="keywords" content="">
    <meta name="description" content="">
    <meta name="author" content="">
    <title>集团电商</title>
    <!--common-->
    <link href="__STATIC__/admin/assets/css/bootstrap.css" rel="stylesheet">
    <script src="__STATIC__/admin/assets/js/jquery.js"></script>
</head>
<body class="sticky-header">
<div class="container" style="padding-top: 10px;">
    <div class="main-title">
        <h2>角色授权</h2>
    </div>
    <div id="auth_groups">
        <form class="form-horizontal" action="{:url('addToGroup')}" method="post">
            <div class="form-group" style="font-weight: bold;"><b style="color: red;">{$nickname}</b> 所属的角色列表</div>
            <div class="form-group">
                {volist name="auth_groups" id="vo"}
                    <label class="checkbox-inline">
                        <input class="caneditstates" type="checkbox" name="group_id[]" value="{$vo.id}">{$vo.title}
                    </label>
                {/volist}
            </div>
            <input type="hidden" name="uid" value="{:input('id')}">
            <input type="hidden" name="batch" value="true">
            <div style="margin-top: 10px;" class="form-group">
                <button type="submit" class="btn btn-success">确 定</button>
            </div>
        </form>
    </div>
    <!--body wrapper end-->
</div>
<script type="text/javascript">
    $(function(){
        var caneditstates = [{$user_groups}];
        $('.caneditstates').each(function(){
            if( $.inArray( parseInt(this.value,10),caneditstates )>-1 ){
                $(this).prop('checked',true);
            }
        });
    });
</script>
</body>
</html>